Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid backend_quota edit war for AZSeparatedResourceTopology #635

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

majewsky
Copy link
Contributor

I'm seeing a lot of this in the DB right now:

psql> SELECT pr.name, pr.quota, pr.backend_quota, par.az, par.quota, par.usage
        FROM project_resources pr
        LEFT OUTER JOIN project_az_resources par ON par.resource_id = pr.id
       WHERE pr.service_id = (
                 SELECT id FROM project_services
                  WHERE type = 'ceph' AND quota_desynced_at IS NOT NULL
                  ORDER BY quota_desynced_at LIMIT 1
             );
+----------------+--------+---------------+----------+-------+-------+
| name           | quota  | backend_quota | az       | quota | usage |
|----------------+--------+---------------+----------+-------+-------|
| local-premium  | <null> | 0             | qa-de-1a | 0     | 0     |
| local-premium  | <null> | 0             | qa-de-1b | 0     | 0     |
| local-premium  | <null> | 0             | qa-de-1d | 0     | 0     |
| region-premium | 0      | 0             | any      | 0     | 0     |
+----------------+--------+---------------+----------+-------+-------+

Scrape wrote a zero into project_resources.backend_quota which caused quota-sync to run and write a null again. This would cause neverending unnecessary quota syncs on all project services with AZSeparatedResourceTopology resources.

The second commit fixes the tests by removing a few other places that tried to set project_resources.{quota,backend_quota} to non-null values.

I'm seeing a lot of this in the DB right now:

```
psql> SELECT pr.name, pr.quota, pr.backend_quota, par.az, par.quota, par.usage
        FROM project_resources pr
        LEFT OUTER JOIN project_az_resources par ON par.resource_id = pr.id
       WHERE pr.service_id = (
                 SELECT id FROM project_services
                  WHERE type = 'ceph' AND quota_desynced_at IS NOT NULL
                  ORDER BY quota_desynced_at LIMIT 1
             );
+----------------+--------+---------------+----------+-------+-------+
| name           | quota  | backend_quota | az       | quota | usage |
|----------------+--------+---------------+----------+-------+-------|
| local-premium  | <null> | 0             | qa-de-1a | 0     | 0     |
| local-premium  | <null> | 0             | qa-de-1b | 0     | 0     |
| local-premium  | <null> | 0             | qa-de-1d | 0     | 0     |
| region-premium | 0      | 0             | any      | 0     | 0     |
+----------------+--------+---------------+----------+-------+-------+
```

Scrape wrote a zero into `project_resources.backend_quota` which caused
quota-sync to run and write a null again.
@majewsky majewsky merged commit bee080e into master Dec 17, 2024
7 checks passed
@majewsky majewsky deleted the avoid-backendquota-edit-war branch December 17, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants